package com.company.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.company.project.entity.StudentEntity;
import com.company.project.mapper.StudentMapper;
import com.company.project.service.StudentService;
import com.company.project.service.TeacherService;
import com.company.project.vo.model.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("studentService")
public class StudentServiceImpl extends ServiceImpl<StudentMapper, StudentEntity> implements StudentService {
    @Autowired
    private TeacherService teacherService;

    @Override
    public StudentVo getStudentByIdTeacher(String str) {
//        StudentEntity studentEntity = baseMapper.selectById(str);
//        String teacherId = studentEntity.getTeacherId();
//        TeacherEntity byId = teacherService.getById(teacherId);
//        StudentVo vo = new StudentVo();
//        BeanUtil.copyProperties(studentEntity,vo);
//        vo.setTeacherEntity(byId);
        StudentVo vo = baseMapper.getStudentByIdTeacher(str);
        return vo;
    }
}